package com.ruoyi.project.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.system.mapper.THospitalOfficeMapper;
import com.ruoyi.project.system.domain.THospitalOffice;
import com.ruoyi.project.system.service.ITHospitalOfficeService;

/**
 * 科室Service业务层处理
 * 
 * @author 孙山伟
 * @date 2020-12-20
 */
@Service
public class THospitalOfficeServiceImpl implements ITHospitalOfficeService 
{
    @Autowired
    private THospitalOfficeMapper tHospitalOfficeMapper;

    /**
     * 查询科室
     * 
     * @param id 科室ID
     * @return 科室
     */
    @Override
    public THospitalOffice selectTHospitalOfficeById(Long id)
    {
        return tHospitalOfficeMapper.selectTHospitalOfficeById(id);
    }

    /**
     * 查询科室列表
     * 
     * @param tHospitalOffice 科室
     * @return 科室
     */
    @Override
    public List<THospitalOffice> selectTHospitalOfficeList(THospitalOffice tHospitalOffice)
    {
        return tHospitalOfficeMapper.selectTHospitalOfficeList(tHospitalOffice);
    }

    /**
     * 新增科室
     * 
     * @param tHospitalOffice 科室
     * @return 结果
     */
    @Override
    public int insertTHospitalOffice(THospitalOffice tHospitalOffice)
    {
        tHospitalOffice.setCreateTime(DateUtils.getNowDate());
        return tHospitalOfficeMapper.insertTHospitalOffice(tHospitalOffice);
    }

    /**
     * 修改科室
     * 
     * @param tHospitalOffice 科室
     * @return 结果
     */
    @Override
    public int updateTHospitalOffice(THospitalOffice tHospitalOffice)
    {
        tHospitalOffice.setUpdateTime(DateUtils.getNowDate());
        return tHospitalOfficeMapper.updateTHospitalOffice(tHospitalOffice);
    }

    /**
     * 批量删除科室
     * 
     * @param ids 需要删除的科室ID
     * @return 结果
     */
    @Override
    public int deleteTHospitalOfficeByIds(Long[] ids)
    {
        return tHospitalOfficeMapper.deleteTHospitalOfficeByIds(ids);
    }

    /**
     * 删除科室信息
     * 
     * @param id 科室ID
     * @return 结果
     */
    @Override
    public int deleteTHospitalOfficeById(Long id)
    {
        return tHospitalOfficeMapper.deleteTHospitalOfficeById(id);
    }
}
